#ifndef __TEMP_Detect_H
#define __TEMP_Detect_H

#ifdef APM32E10X_HD
	#include "apm32e10x_adc.h"
	#include "apm32e10x_dma.h"
	#include "apm32e10x_rcm.h"
	#include "apm32e10x_gpio.h"
	
#elif defined AT32F403AVGT7
	#include "at32f403a_407_adc.h"
	#include "at32f403a_407_dma.h"
	#include "at32f403a_407_crm.h"
	#include "at32f403a_407_gpio.h"

#else
	#include "apm32f10x_adc.h"
	#include "apm32f10x_dma.h"
	#include "apm32f10x_rcm.h"
	#include "apm32f10x_gpio.h"
	
#endif
#include "SQDriConfig.h"


// 温度ADC引脚 // 
#if defined SQDri_EVSEB_7KW 
	//板载温度传感器引脚 = PC4
	#define TEMP_RTC             RCM_APB2_PERIPH_GPIOC
	#define TEMP_PinPort         GPIOC
	#define TEMP1_PinId          GPIO_PIN_4 
	#define TEMP1_ADC_Chn        ADC_CHANNEL_14                // 温度ADC通道
  
	#if tmpr_nums > 1
	// 外接温度传感器1引脚 = PC2
	#define TEMP2_RTC            RCM_APB2_PERIPH_GPIOC  
	#define TEMP2_PinPort        GPIOC  
	#define TEMP2_PinId          GPIO_PIN_2  
	#define TEMP2_ADC_Chn        ADC_CHANNEL_2                 // 温度ADC通道
  #endif
  	
#elif defined SQDri_EVSEB_11KW
	//板载温度传感器引脚 = PC4
	#define TEMP_RTC             RCM_APB2_PERIPH_GPIOC
	#define TEMP_PinPort         GPIOC
	#define TEMP1_PinId          GPIO_PIN_4 
	#define TEMP1_ADC_Chn        ADC_CHANNEL_14                 // 温度ADC通道

  #if tmpr_nums > 1
	// 外接温度传感器1引脚 = 外接NTC = PC3
	#define TEMP2_RTC            RCM_APB2_PERIPH_GPIOC  
	#define TEMP2_PinPort        GPIOC  
	#define TEMP2_PinId          GPIO_PIN_3  
	#define TEMP2_ADC_Chn        ADC_CHANNEL_3                   // 温度ADC通道 
	#endif
	
	#if tmpr_nums > 2	 
	// 外接温度传感器1引脚 = 外接枪温检测 = PC2
	#define TEMP3_RTC            RCM_APB2_PERIPH_GPIOC  
	#define TEMP3_PinPort        GPIOC  
	#define TEMP3_PinId          GPIO_PIN_2  
	#define TEMP3_ADC_Chn        ADC_CHANNEL_2                   // 温度ADC通道 
  #endif
	
#else
	//引脚块1 = 接引脚块B
	#define TEMP_RTC             RCM_APB2_PERIPH_GPIOA
	#define TEMP_PinPort         GPIOA	
	#define TEMP1_PinId          GPIO_PIN_0      // 板载温度传感器 = PA0	
	#define TEMP1_ADC_Chn        ADC_CHANNEL_0   // 温度ADC通道
   
	#if tmpr_nums > 1
	#if PinPick_RatedI == 0	
	#define TEMP2_PinId          GPIO_PIN_2      // 外接温度传感器 = PA2     //PA2被占用
	#define TEMP2_ADC_Chn        ADC_CHANNEL_2
	#endif
	#endif
	
	#if tmpr_nums > 2	
	#define TEMP3_PinId          GPIO_PIN_3      // 外接温度传感器 = PA3
	#define TEMP3_ADC_Chn        ADC_CHANNEL_3
  #endif
	
#endif


void ADC_TEMP_Init(void);

#endif

